import java.util.ArrayList;
import java.util.List;

/**
 * @author 21195
 * @version v1.0
 * @package PACKAGE_NAME
 * @description:
 * @date 2019/8/13 21:07
 **/
public class Test{
    public static void main(String[] args) {
        int[] arr = {45, 18, 35, 45, 48, 45, 48, 18, 35, 45, 15};
        List<Integer> list = new ArrayList<>();
        for (int arrs : arr) {
            list.add(arrs);
        }
        System.out.println(test(list));
        System.out.println(test(list));
    }
    public static List test(List list){
        if (list.size()>1){
            for (int i = 0; i < list.size() - 1; i++) {
                for (int j = list.size() - 1; j > i; j--) {
                    if (list.get(j).equals(list.get(i))) {
                        list.remove(j);
                        list.remove(i);
                    }
                }
            }
        }
        return list;
    }


    }


